<?php
/**
 * 门面模式
 * Created by PhpStorm.
 * User: tangzhou
 * Date: 16-9-1
 * Time: 下午10:24
 */

class Ali
{
    function buy()
    {
        echo "买ali股票";
    }

    function sale()
    {
        echo "卖ali股票";
    }
}

class Icsoc
{
    function buy()
    {
        echo "买icsoc股票";
    }

    function sale()
    {
        echo "卖icsoc股票";
    }
}

/**
 * 基金公司
 * Class FacadeCompany
 */
class FacadeCompany
{
    private $ali;
    private $icsoc;
    function __construct()
    {
        $this->ali = new Ali();
        $this->icsoc = new Icsoc();
    }

    function buy()
    {
        $this->ali->buy();
        $this->icsoc->buy();
    }

    function sale()
    {
        $this->ali->sale();
    }
}

$facade = new FacadeCompany();
$facade->buy();
$facade->sale();